// SyncFiles.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "SyncFileServer.h"
#include "SyncFileClient.h"

int _tmain(int argc, _TCHAR* argv[])
{
	net::CreateNetwork(net::asio);
	net::InitNetwork(4);

	if( argc > 1 && _tcsicmp( argv[1], _T("-server") ) == 0 )
	{
		std::ifstream file( "config.json" );
		Json::Reader Reader;
		Json::Value ServerConfig;
		Reader.parse( file, ServerConfig );
		CallServer( ServerConfig );
	}
	else
	{
		CallClient();
	}
	net::FiniNetwork();
	net::DestroyNetwork();
	return 0;
}

